import { getCurrentPageUser } from '@/api/index'
export default {
  namespaced: true,
  state: {
    userInfo: [],
    total: 0,
    isDialog: false
  },
  mutations: {
    // 获取当前页用户信息
    getCurrentPageUser (state, payload) {
      state.userInfo = payload.data // 用户信息
      state.total = payload.total // 总的数据
    },
    changeIsDialog (state, bool) {
      state.isDialog = bool
    }
  },
  actions: {
    // 获取当前页用户信息
    async getCurrentPageUser ({ commit }, params) {
      const data = await getCurrentPageUser(params)
      console.log(data)
      commit('getCurrentPageUser', data)
    }
  }
}
